Create an API to create/update/delete service event rules

Hi,

We are automating the creation of teams, escalation policies, schedules, and global event rules. We use terraform to create these PagerDuty objects and the rest api to create the global event rules.

We cannot fully automate the set up as we have to manually enter the service event rules as there is no API for it. We use the service event rules to set the priority and severity of the incident based on the payload we have received from our alerting tool.

I can see this feature has already been requested in another topic a while go.

Can you please provide an update on this.

Thanks

Hi Yasin,

Thanks for posting your interest in a Service Event Rules API. We do have this feature on our roadmap for a future date so unfortunately it is not available at this time.

You mentioned that you are sending events and routing them using Global Event Rules. It is also possible to set Severity and Priority with a Global Event Rule. Can you help me understand why you would want to handle the logic with rules at both the Global and Service level?

Regards,
Sean

Hi Sean,

Thank you for your response, we do not want users meddling Global Event Rule, however, if they were to do this on on their own service it reduces the blast radius.

Regards
Yasin

Thanks for clarifying your use-case! I did note with Sean that we’ll reach out to you once permissions-based event rules are available to maintain via the REST API.

An additional use case that our company has identified is one covered by this topic here: /forum/t/event-rules-add-ability-to-continue-processing-rules/1698 . We want to be able to do something similar to this and manage setting the rules completely via the API as we store all our configuration for PD as code.

1 Like

Owning two dozens services, it’s pretty painful and error prone to maintain event rules from the UI. Given that our company has a couple of dozen service owners with hundreds of services that probably all have the same issues, I wonder if why this functionality, like so many other, is not available in the REST API.
I would much appreciate if there would be a unified REST-API for the PD web UI as well as customer integrations. Every possible enthusiasm for new PD features in the last two years has always been curbed by the automatic thought “yeah nice, but when, if ever, will it be available in the API, so we can add it to our automation”.

1 Like

Same issue here , any idea when I can use the API to manage the service event rules ?

any update on this? is there a date for this feature to be implemented?

So to clarify it IS possible to create global event rules and it is NOT possible to create service level event rules, all via Terraform?

Is it possible to import all the current global event rules into a tfstate file?

It is possible to create rulesets and rules (formerly known as global event rules) via Terraform. It is NOT possible to create Service Level Event rules as there is no public API available for that yet.

It is possible to import ruleset rules into your TF state file.

Doug

@BKeny01
we are happy to announce that our Service Event Rules API is Generally Available. You can find the CRUD Calls nested in the Services Endpoint:
https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1services~1{id}~1rules/post

Terraform support will be added soon. Check our terraform provider release notes for updates.

1 Like